const { notEmpty , validatorResult } = require("./validator");

/**
 * 获取某一个登录用户的群列表
 */
exports.get_groups_validator = async (ctx, next) => {
    const errors = {};
    let result = notEmpty(ctx)(errors, "_id", "query");
        await validatorResult(result,ctx,next);
};

/**
 * 获取群号查询一个群 
 */
exports.get_group_validator = async  (ctx,next) => {
    const errors = {};
    let result = notEmpty(ctx)(errors, "group_number", "query");
        await validatorResult(result,ctx,next);
}

/**
 * 添加一个人到群组内
 */
exports.add_group_member_validator = async (ctx,next) => {
    const errors = {};
    let result = notEmpty(ctx)(errors, "fromId", "body");
        result = notEmpty(ctx)(errors, "groupId", "body");
        await validatorResult(result,ctx,next);
}


exports.add_group_validator = async (ctx,next) => {
    const errors = {};
    let result = notEmpty(ctx)(errors, "group_number", "body");
        result = notEmpty(ctx)(errors, "group_name", "body");
        result = notEmpty(ctx)(errors, "group_creator", "body");
        await validatorResult(result,ctx,next);
}